
score {
	
	current.value = 1/2
	
    phrase =  C| C| C*2/3|D/3|E| E*2/3|D/3|E*2/3|F/3|  G*2| 
    (C(1)|C(1)|C(1))/3|(G|G|G)/3|(E|E|E)/3|(C|C|C)/3|G*2/3|F/3|   E*2/3|D/3| C*2
	
    
	flute = voice(FLUTE)
	trumpet = voice(TRUMPET)
	clarinet = voice(CLARINET)

	flute << 2*phrase.transpose(12)
    trumpet << R*4 << 2*phrase
    clarinet << R*8 << 2*phrase.transpose(-12)
	
    close()
    dump sequence
    save sequence
    play sequence

    evaluate new File('scripts/DumpMidiFile.groovy')    

//	Lets write the music in a convenient way.

//	Make two new phrases and change start times to make a round
//	Play different parts in different octaves
//	phrase2 = copy(phrase1,startTime:4.0).transpose(12)
//	phrase3 = copy(phrase1,startTime:8.0).transpose(-12)
//	println '>>>'+phrase1
//	println '>>>'+phrase2
//	println '>>>'+phrase3

//	add phrases to the parts
//	loop phrases once
//	flute << 2*phrase1      
//	trumpet << (phrase2 | phrase2)
//	clarinet << 2*phrase3
	        
//	OK now we do a SMF write 
//	Write.midi(score, "rowboat.mid");
//	printAll score
//	play score

}
